//app.js
const func = require('utils/util.js')
import $http from 'utils/request.js'
App({
  globalData: {},
  onLaunch: function () {
    // 登录
    wx.login({
      success: res => {
        const url = 'https://www.bisaiquan.cn/api/wechat/login'
        const data = {
          code: res.code
        }
        wx.request({
          url: url,
          data: data,
          method: 'POST',
          success (response) {
            wx.setStorageSync('openToken', response.data.data.open_token)
          }
        })
      }
    })
  },
  $http,
  pageNavigateTo: func.pageNavigateTo
})